<template>
  <component :is="formCom" :type="type" :status="status"/>
</template>

<script>
import loginForm from '@/components/login'
import emailForm from '@/components/email'
import passwordForm from '@/components/password'

export default {
  name: 'factoryForm',
  components: {
    loginForm,
    emailForm,
    passwordForm
  },
  props: {
    type: {
      default: ''
    },
    status: {
      default: 1
    }
  },
  data () {
    return {
      formType: {
        login: 'loginForm',
        email: 'emailForm',
        password: 'passwordForm'
      }
    }
  },
  computed: {
    formCom () {
      return this.formType[this.type]
    }
  }
}
</script>

<style scoped>

</style>
